package com.eedi.framework.oauth2.enums;


import com.eedi.framework.common.exception.ErrorCode;
import com.eedi.sys.enums.SysErrorCode;
import com.eedi.sys.enums.SysErrorCodeType;

/**
 * System 错误码枚举类
 *
 * system 系统，使用 1-002-000-000 段
 */
public interface SysOauth2ErrorCodeConstants {



    // ========== OAuth2 客户端 1-002-020-000 =========
    ErrorCode SYS_OAUTH2_CLIENT_NOT_EXISTS = new SysErrorCode(SysErrorCodeType.OAUTH2,000, "OAuth2 客户端不存在");
    ErrorCode SYS_OAUTH2_CLIENT_EXISTS = new  SysErrorCode(SysErrorCodeType.OAUTH2,1, "OAuth2 客户端编号已存在");
    ErrorCode SYS_OAUTH2_CLIENT_DISABLE = new  SysErrorCode(SysErrorCodeType.OAUTH2,2, "OAuth2 客户端已禁用");
    ErrorCode SYS_OAUTH2_CLIENT_AUTHORIZED_GRANT_TYPE_NOT_EXISTS = new  SysErrorCode(SysErrorCodeType.OAUTH2,3, "不支持该授权类型");
    ErrorCode SYS_OAUTH2_CLIENT_SCOPE_OVER = new  SysErrorCode(SysErrorCodeType.OAUTH2,4, "授权范围过大");
    ErrorCode SYS_OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH = new  SysErrorCode(SysErrorCodeType.OAUTH2,5, "无效 redirect_uri: {}");
    ErrorCode SYS_OAUTH2_CLIENT_CLIENT_SECRET_ERROR = new  SysErrorCode(SysErrorCodeType.OAUTH2,6, "无效 client_secret: {}");

    // ========== OAuth2 授权 1-002-021-000 =========
    ErrorCode SYS_OAUTH2_GRANT_CLIENT_ID_MISMATCH = new  SysErrorCode(SysErrorCodeType.OAUTH2,7, "client_id 不匹配");
    ErrorCode SYS_OAUTH2_GRANT_REDIRECT_URI_MISMATCH = new SysErrorCode(SysErrorCodeType.OAUTH2,8, "redirect_uri 不匹配");
    ErrorCode SYS_OAUTH2_GRANT_STATE_MISMATCH = new  SysErrorCode(SysErrorCodeType.OAUTH2,9, "state 不匹配");
    ErrorCode SYS_OAUTH2_GRANT_CODE_NOT_EXISTS = new  SysErrorCode(SysErrorCodeType.OAUTH2,10, "code 不存在");


    // ========== OAuth2 授权 1-002-022-000 =========
    ErrorCode SYS_OAUTH2_CODE_NOT_EXISTS = new  SysErrorCode(SysErrorCodeType.OAUTH2,11, "code 不存在");
    ErrorCode SYS_OAUTH2_CODE_EXPIRE = new  SysErrorCode(SysErrorCodeType.OAUTH2,12, "code 已过期");
    ErrorCode SYS_OAUTH2_REFRESH_TOKEN_ERROR = new  SysErrorCode(SysErrorCodeType.OAUTH2,13, "刷新TOKEN失败");

    // ========== AUTH 模块 1-002-000-000 ==========
    ErrorCode SYS_AUTH_LOGIN_BAD_CREDENTIALS = new SysErrorCode(SysErrorCodeType.OAUTH2,13, "登录失败，账号密码不正确");
    ErrorCode SYS_AUTH_LOGIN_USER_DISABLED = new SysErrorCode(SysErrorCodeType.OAUTH2,14, "登录失败，账号被禁用");
    ErrorCode SYS_AUTH_LOGIN_CAPTCHA_CODE_ERROR = new SysErrorCode(SysErrorCodeType.OAUTH2,15, "验证码不正确，原因：{}");
    ErrorCode SYS_AUTH_THIRD_LOGIN_NOT_BIND = new SysErrorCode(SysErrorCodeType.OAUTH2,16, "未绑定账号，需要进行绑定");
    ErrorCode SYS_AUTH_TOKEN_EXPIRED = new SysErrorCode(SysErrorCodeType.OAUTH2,17, "Token 已经过期");
    ErrorCode SYS_AUTH_MOBILE_NOT_EXISTS = new SysErrorCode(SysErrorCodeType.OAUTH2,18, "手机号不存在");



}
